import request from '@/utils/request'


export function getCustomerList(query = {}) {
    return request({
        url: '/api/admin/customer/list',
        method: 'post',
        data: query
    })
}
export function stockCustomerItem(data) {
    return request({
        url: '/api/admin/customer/stock',
        method: 'post',
        data
    })
}
export function subCustomerItem(data) {
    return request({
        url: '/api/admin/customer/repo',
        method: 'post',
        data
    })
}
export function getCustomerDetail(id) {
    return request({
        url: '/api/admin/customer/info/' + id,
        method: 'get'
    })
}

export function updateCustomerInfo(data) {
    return request({
        url: '/api/admin/customer/updateCustomerInfo',
        method: 'post',
        data
    })
}
export function changeCustomerItemSate(data) {
    return request({
        url: '/api/admin/customer/updateCustomerStatus',
        method: 'post',
        data
    })
}

export function getCustomerFundList(query = {}) {
    return request({
        url: '/api/admin/cusCapitalLog/list',
        method: 'post',
        data: query
    })
}   

export function auditCustomerFund(data) {
    return request({
        url: '/api/admin/cusCapitalLog/auditCapitalLog',
        method: 'post',
        data
    })
}

/**
 * 回款初审
 * @param data 请求参数
 * @returns {*} 响应结果
 */
export function encashPreAudit(data) {
    return request({
        url: '/api/admin/cusCapitalLog/encashFirstAudit',
        method: 'post',
        data
    })
}

export function auditCustomer(data) {
    return request({
        url: '/api/admin/customer/auditCustomer',
        method: 'post',
        data
    })
}


export function getCustomerConfig(cusId) {
    return request({
        url: '/api/admin/customer/getCusConfig/' + cusId,
        method: 'get'
    })
}

export function updateCustomerConfig(data) {
    return request({
        url: '/api/admin/customer/updateCusConfig',
        method: 'post',
        data
    })
}

export function refreshCustomerRedis(params) {
    return request({
        url: '/api/admin/customer/refreshCustomerInfo/' + params,
        method: 'get'
    })
}

export function getCustomerFundDetail(id) {
    return request({
        url: '/api/admin/cusCapitalLog/info/' + id,
        method: 'get'
    })
}

/**
 * 获取业务员列表
 * @returns {Promise<AxiosResponse<any>> | *}
 */
export function getCountermanList(){
    return request({
        url: '/api/admin/sysUser/getUsersByRoleCode/counterman',
        method: 'get'
    })
}


